package cn.stacey.day08;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

public class DemoMap {
	private String[] MONTHS= {"一月","二月","三月","四月"};
	private String[] EN_MONTHS= {"January","February","March","April"};
	private int[] ROOM= {202,203,605,421};
	private String[] NAME= {"袁大头","吕小弟","夏雨荷","陈哈哈"};
	
	@Test
	public void testMap() {
		
		Map<String,String> map=new HashMap<>();
//		map.put("一月", "January");
//		System.out.println(map.get("一月"));
//		System.out.println(map.get("二月"));
		for(int i=0;i<MONTHS.length;i++) {
			String key=MONTHS[i];
			String value=EN_MONTHS[i];
			map.put(key, value);
			
		}
		
		System.out.println(map.get("二月")+"\t"+map.get("四月"));
		
	}
	
	@Test
	public void testMap1() {
		Map<Integer,String> map=new HashMap<>();
		for(int i=0;i<ROOM.length;i++) {
			Integer key=ROOM[i];
			String value=NAME[i];
			map.put(key, value);
		}
		System.out.println(map.get(202));
		System.out.println(map.get(421));
		System.out.println(map.get(203));
	}
}

